# coding: utf8

# ready -> ready to challenge the ladder
# resting -> already at current ladder position, accepting challenges
# benched -> not runnable
db.define_table('competitor',
    Field('status', requires=IS_IN_SET(['ready', 'resting', 'benched'])),
    Field('name_user', length=10),
    Field('name_player', length=20),
    format='%(name_user)s/%(name_player)s'
    )

db.define_table('match',
    Field('time', 'datetime'),
    Field('winner_color', requires=IS_IN_SET(['red', 'blue'])),
    Field('winner', db.competitor),
    Field('loser', db.competitor),
    Field('output', length=200),
    format='%(time)s: %(winner)s (%(winner_color)s) over %(loser)s'
    )
